//
//  YHCollectionViewLauout.h
//  LyhToolsTest
//
//  Created by 李彦宏 on 2019/9/7.
//  Copyright © 2019 LYH.com. All rights reserved.
//

#import <UIKit/UIKit.h>
@class YHCollectionViewLauout;
NS_ASSUME_NONNULL_BEGIN
typedef enum
{
    YHWaterFlowVerticalEqualWidth = 0, /** 竖向瀑布流 item等宽不等高 */
    YHWaterFlowHorizontalEqualHeight = 1, /** 水平瀑布流 item等高不等宽 不支持头脚视图*/
    YHWaterFlowVerticalEqualHeight = 2,  /** 竖向瀑布流 item等高不等宽 */
}YHWaterFlowLayoutStyle;

@protocol YHCollectionViewLauoutDelegate <NSObject>

@optional
- (CGSize)waterFlowLayout:(YHCollectionViewLauout *)waterFlowLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;

/** 头视图Size */
-(CGSize )waterFlowLayout:(YHCollectionViewLauout *)waterFlowLayout sizeForHeaderViewInSection:(NSInteger)section;
/** 脚视图Size */
-(CGSize )waterFlowLayout:(YHCollectionViewLauout *)waterFlowLayout sizeForFooterViewInSection:(NSInteger)section;

@optional //以下都有默认值
/** 列数*/
-(CGFloat)columnCountInWaterFlowLayout:(YHCollectionViewLauout *)waterFlowLayout;
/** 行数*/
-(CGFloat)rowCountInWaterFlowLayout:(YHCollectionViewLauout *)waterFlowLayout;

/** 列间距*/
-(CGFloat)columnMarginInWaterFlowLayout:(YHCollectionViewLauout *)waterFlowLayout;
/** 行间距*/
-(CGFloat)rowMarginInWaterFlowLayout:(YHCollectionViewLauout *)waterFlowLayout;
/** 边缘之间的间距*/
-(UIEdgeInsets)edgeInsetInWaterFlowLayout:(YHCollectionViewLauout *)waterFlowLayout;
@end

@interface YHCollectionViewLauout : UICollectionViewLayout

@property (nonatomic, weak) id <YHCollectionViewLauoutDelegate>delegate;

@property (nonatomic, assign) YHWaterFlowLayoutStyle flowLayoutStyle;
@end

NS_ASSUME_NONNULL_END
